﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;

namespace Dune2013
{
    public class Recolector:Actor
    {
        public float maxSize = 2.0f;
        public float maxNafta = 300;
        public float carga = 0;
        public float nafta = 300;

        public bool noHayMasPozos = false;

        public int hp = StaticStuff.maxVidaRecolector;
        public Recolector(Behavior bh)
        {
            changeBehavior(bh);
            maxSpeed = speed = StaticStuff.rapidezRecolector;
            maxTurnSpeed = StaticStuff.maxTurnSpeedRecolector;//.1f;
            this.tex = StaticStuff.getTextureById(StaticStuff.tiposTexturas.RECOLECTOR);
            
        }
        public override void update(int dTime)
        {
            if (noHayMasPozos) return;
            Vector2 totalForce = new Vector2(0, 0);

            totalForce += followPath();
            tryOrientation(totalForce);
            base.update(dTime);

        }

        public void restarVida(int cuanto){
            hp -= cuanto;
            if (hp <= 0) {
                destruir();
            }
        }
        public void destruir() {
            ActorManager.getInstance().borrar(this);
        }
    }
}
